﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Jhong.FunMVC
{
    public abstract class HttpMethodAttribute : Attribute
    {
        public HttpMethodAttribute(HttpMethod method)
        {
            this.HttpMethod = method;
        }

        public HttpMethod HttpMethod { get; private set; }

    }

    public class HttpGetAttribute : HttpMethodAttribute
    {
        public HttpGetAttribute() : base(HttpMethod.GET) { }
    }

    public class HttpPostAttribute : HttpMethodAttribute
    {
        public HttpPostAttribute() : base(HttpMethod.POST) { }
    }

    public class HttpHeadAttribute : HttpMethodAttribute
    {
        public HttpHeadAttribute() : base(HttpMethod.Head) { }
    }

    public class HttpPutAttribute : HttpMethodAttribute
    {
        public HttpPutAttribute() : base(HttpMethod.PUT) { }
    }

    public class HttpDeleteAttribute : HttpMethodAttribute
    {
        public HttpDeleteAttribute() : base(HttpMethod.DELETE) { }
    }

    public class HttpPatchAttribute : HttpMethodAttribute
    {
        public HttpPatchAttribute() : base(HttpMethod.PATCH) { }
    }

    public enum HttpMethod
    {
        GET,
        POST,
        Head,
        PUT,
        DELETE,
        PATCH
    }
}
